package com.example.demo.config;

import com.example.demo.model.User;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.beans.factory.config.SingletonBeanRegistry;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.web.context.annotation.RequestScope;
import org.springframework.web.context.annotation.SessionScope;

import java.util.LinkedList;
import java.util.List;

@Configuration
public class UserConfig {

    @Bean
    public User getUser1(){
        return new User();
    }
    @Bean
    User getUser2(){
        return new User();
    }

   @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
   @Bean
    public User getUser3(){
        return new User();
    }


    @Bean
    public User getUser4(){
        return new User();
    }

    @SessionScope
    @Bean
    public User getUser5(){
        return new User();
    }
}
